# model

# in the first place this class is only a place, where the necessary attributes are loaded to call the responsible builder-class 'BuildChooseRaidLevel'
# maybe in the future, this class can be a place, where a real configuration-page is presented...

from google.appengine.ext import webapp
from controller.BuildChooseRaidLevel import BuildChooseRaidLevel 

from Utilities import Utilities

class RaidLevelConfig(webapp.RequestHandler):    
    def get(self):
        utilities = Utilities()
        
        # get some basic data
        username = utilities.getUsername()
        userText = utilities.getUserText()
        
        # routine if user is logged-in or not
        if username:
            urlText = utilities.getUrlTextLogout()
            url = utilities.getLogout(self)
            hintText = ''
            hintColor = ''
            
            self.callBuilder(userText, username, url, urlText, hintText, hintColor)
        else:
            self.redirect('/')
            
    # call the get-method from the BuildChooseRaidLevel-class
    def callBuilder(self, userText, username, url, urlText, hintText, hintColor):
        templateValues = {
                           'userText': userText,
                           'user': username,
                           'url': url,
                           'urlText': urlText,
                           'hintText': hintText,
                           'hintColor': hintColor,
                          }
        
        builder = BuildChooseRaidLevel()
        builder.get(self, templateValues)


